package jdk7;

/**
 * @author honway.liu
 * @date 2018/4/30 下午9:10
 * @email gm100861@gmail.com
 * @blog http://linuxsogood.org
 */
public class Account implements Comparable{
    private String name;
    private String number;
    private int blance;

    @Override
    public String toString() {
        return "Account{" +
                "name='" + name + '\'' +
                ", number='" + number + '\'' +
                ", blance=" + blance +
                '}';
    }

    public Account(String name, String number, int blance) {
        this.name = name;
        this.number = number;
        this.blance = blance;
    }

    @Override
    public int compareTo(Object o) {
        Account that = (Account) o;
        return that.blance - this.blance;
    }
}
